package com.uphone.edwards.adapter;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.uphone.edwards.R;

public class ContentsAdapter extends MybaseAdapter<String> {
    public ContentsAdapter(Context context) {
        super(context);
    }


    @Override
    public View setView(final int posi, View converView, ViewGroup parent) {
        final ViewHolder holderView;
        if (converView == null) {
            converView = inflater.inflate(R.layout.item_catalogue, null);
            holderView = new ViewHolder(converView);
            converView.setTag(holderView);
        } else {
            holderView = (ViewHolder) converView.getTag();
        }
        String item = getItem(posi);
        Log.e("item" , posi + "++" + list.size());
        if (posi == list.size() - 1){
            holderView.tvItem.setText(item);
            holderView.tvItem.setTextColor(0xffDB0225);
        }else{
            holderView.tvItem.setText("第" + posi + "行");

        }
        return converView;
    }
    class ViewHolder{
        public TextView tvItem;

        public ViewHolder(View v){
            tvItem = v.findViewById(R.id.tv_item);
        }
    }
}
